        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>MassData class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="MassData">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/MassData.html">MassData</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>MassData</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class MassData {
 /** The mass of the shape, usually in kilograms. */
 num mass;

 /** The position of the shape's centroid relative to the shape's origin. */
 vec2 center;

 /** The rotational inertia of the shape about the local origin. */
 num inertia;

 /**
  * Constructs a blank mass data.
  */
 MassData() :
   mass = 0,
   inertia = 0,
   center = new vec2.zero() { }

 /**
  * Copies from the given mass data.
  */
 MassData.copy(MassData md) :
   mass = md.mass,
   inertia = md.inertia,
   center = new vec2.copy(md.center) { }

 /**
  * Sets this mass data equal to the given mass data.
  */
 void setFrom(MassData md) {
   mass = md.mass;
   inertia = md.inertia;
   center.copyFrom(md.center);
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="MassData">
<button class="show-code">Code</button>
new <strong>MassData</strong>() <a class="anchor-link" href="#MassData"
              title="Permalink to MassData.MassData">#</a></h4>
<div class="doc">
<p>Constructs a blank mass data.</p>
<pre class="source">
MassData() :
 mass = 0,
 inertia = 0,
 center = new vec2.zero() { }
</pre>
</div>
</div>
<div class="method"><h4 id="MassData.copy">
<button class="show-code">Code</button>
new <strong>MassData.copy</strong>(<a href="../box2d/MassData.html">MassData</a> md) <a class="anchor-link" href="#MassData.copy"
              title="Permalink to MassData.MassData.copy">#</a></h4>
<div class="doc">
<p>Copies from the given mass data.</p>
<pre class="source">
MassData.copy(MassData md) :
 mass = md.mass,
 inertia = md.inertia,
 center = new vec2.copy(md.center) { }
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="center">
<button class="show-code">Code</button>
<a href="../vector_math/vec2.html">vec2</a>         <strong>center</strong> <a class="anchor-link"
            href="#center"
            title="Permalink to MassData.center">#</a>
        </h4>
        <div class="doc">
<pre class="source">
center
</pre>
</div>
</div>
<div class="field"><h4 id="inertia">
<button class="show-code">Code</button>
num         <strong>inertia</strong> <a class="anchor-link"
            href="#inertia"
            title="Permalink to MassData.inertia">#</a>
        </h4>
        <div class="doc">
<pre class="source">
inertia
</pre>
</div>
</div>
<div class="field"><h4 id="mass">
<button class="show-code">Code</button>
num         <strong>mass</strong> <a class="anchor-link"
            href="#mass"
            title="Permalink to MassData.mass">#</a>
        </h4>
        <div class="doc">
<pre class="source">
mass
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="setFrom">
<button class="show-code">Code</button>
void <strong>setFrom</strong>(<a href="../box2d/MassData.html">MassData</a> md) <a class="anchor-link" href="#setFrom"
              title="Permalink to MassData.setFrom">#</a></h4>
<div class="doc">
<p>Sets this mass data equal to the given mass data.</p>
<pre class="source">
void setFrom(MassData md) {
 mass = md.mass;
 inertia = md.inertia;
 center.copyFrom(md.center);
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
